import {getImgUrl} from "@/utils";
import {Image} from "antd-mobile";
import {FC, ReactElement} from "react";
import "./block.less";

interface GoodsBlockProps {
    url?: string;
    title?: string;
    item: string;
    onClick?: (e?: any) => any;
    children?: ReactElement | any;
}

const GoodsBlock: FC<GoodsBlockProps> = ({title = "", url = "", children = "", onClick}) => (
    <div className="goods-block-components" onClick={() => onClick?.()}>
        <Image src={getImgUrl(url)} style={{width: "100%", height: "auto"}} />
        <div style={{marginTop: "8px"}}>{title}</div>
        <div style={{color: "red", fontSize: "18px"}}>{18}</div>
        {children}
    </div>
);

export default GoodsBlock;
